#include "rsrc_init.h"

/* mboot */
#include "mboot.h"

/* Private function prototypes -----------------------------------------------*/

/* Private user code ---------------------------------------------------------*/

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

/* mboot 接口 */
static mboot_op *s_mboot_op;

/* USER CODE END 0 */

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{
    /* USER CODE BEGIN 1 */

    /* 系统资源初始化 */
    system_rsrc_init();

    /* 注册 mboot 操作接口 */
    s_mboot_op = mboot_op_register();
    s_mboot_op->init();
    s_mboot_op->boot_delay(3);

    HAL_GPIO_WritePin(LED_B_GPIO_Port,LED_B_Pin,GPIO_PIN_SET);
    HAL_GPIO_WritePin(LED_R_GPIO_Port,LED_R_Pin,GPIO_PIN_SET);

    /* USER CODE END 2 */
    
    /* Infinite loop */
    /* USER CODE BEGIN WHILE */
    while (1)
    {
        /* USER CODE END WHILE */
    
        /* USER CODE BEGIN 3 */

        HAL_GPIO_WritePin(LED_B_GPIO_Port,LED_B_Pin,GPIO_PIN_RESET);
        HAL_Delay(50);
        HAL_GPIO_WritePin(LED_B_GPIO_Port,LED_B_Pin,GPIO_PIN_SET);
        HAL_Delay(50);

        /* USER CODE END 3 */
    }
}
